<%@ Page Language="C#" EnableViewState="false" ValidateRequest="false" AutoEventWireup="true" EnableEventValidation="false"
MasterPageFile="~/App_ThemeMasters/NoStyle/TwoColumnLayout.Master" Inherits="Syrinx.Gui.AspNet.Ajax.NitobiBasePage" %>
<%@ Register Assembly="Swaf.Gui.AspNet2" Namespace="Swaf.Gui.AspNet2" TagPrefix="swf" %>
<%@ Register Assembly="ScsAspNet" Namespace="Syrinx.Gui.AspNet" TagPrefix="syx" %>
<%@ Register Assembly="ScsAspNet" Namespace="Syrinx.Gui.AspNet.Ajax" TagPrefix="saj" %><%@ Register Assembly="NitobiControls" Namespace="Nitobi" TagPrefix="ntb" %>
<%@ Register Assembly="ScsAspNet" Namespace="Articles.Gui.AspNet" TagPrefix="art" %>

<!--#include file="~/SiteControls/RegisterStandardControls.txt"-->
<!--#include file="../SiteControls/StandardHeaderPageContent-NoCart.inc"-->
<!--#include file="../SiteControls/StandardFooterPageContent.inc"-->

<asp:Content ContentPlaceHolderID="aboveMain" runat="server" id="c0">
    <art:StandAloneArticleListDisplay runat="server" ID="saald1" 
        PID="RegisteringCheckOutInfo" 
        ImageRes="" 
	    IncludeSelf="true" 
	    MaxElements="1"
	    ListTemplate="TitleImageBody" DetailLevel="fullDetails" 
	     />
</asp:Content>

<asp:Content ContentPlaceHolderID="mainLeft" runat="server" ID="c1">
	<swf:BizProc ID="sArt1" runat="server" factoryName="eComProducts">
		<State entireTree="true"  EditModeSessionKey="GlobalEdit" startDepth="0" endDepth="0" includeSelf="true"/>
		<ParentBizProc id="loginBP" />
	</swf:BizProc>
	<swf:BizProc ID="dArt1" runat="server" factoryName="eComProducts">
		<State entireTree="true" EditModeSessionKey="GlobalEdit" startDepth="0" endDepth="1"  />
		<ParentBizProc id="sArt1" fieldName="id" dataId="pid"/>
	</swf:BizProc>

	<swf:BizProc ID="orderItemBP" runat="server" FactoryName="eComSalesOrderItems">
		<State  entireTree="false"  baseListFieldNameforMaster="product" masterDataDisplay="blOnly"/>
		<ParentBizProc id="orderBP" fieldName="id" dataId="pid" />
	</swf:BizProc>
	
	<swf:BizProc runat="server" ID="wizard" FactoryName="createNewCommunity">
		<ParentBizProc id="orderBP" dataId="orderInfo" />
		<ParentBizProc id="checkout" dataId="info" />
    </swf:BizProc>
    <swf:BizProc ID="signupBP" runat="server" FactoryName="contactSignUpBP" >
		<ParentBizProc id="orderBP" dataId="orderInfo"  cacheValue="false" />
		<ParentBizProc id="checkout" dataId="info" />
	</swf:BizProc>
	<swf:BizProc runat="server" ID="captcha" FactoryName="captchaVerify">
		<ParentBizProc id="loginBP" />
		<ParentBizProc id="signupBP" dataId="pid" />
	</swf:BizProc>
	<swf:BizProc ID="delivery" runat="server" FactoryName="salesOrderDeliveryOptions">
		<ParentBizProc id="orderBP" dataId="orderInfo" cacheValue="false" />		
		<ParentBizProc id="checkout" dataId="info"  cacheValue="false"  />
		<ParentBizProc id="orderItemBP" cacheValue="false" />
	</swf:BizProc>
    <swf:BizProc ID="paymentType" runat="server" FactoryName="salesOrderPaymentWizard" >
		<ParentBizProc id="orderBP" dataId="orderInfo" cacheValue="false" />
		<ParentBizProc id="checkout" dataId="info" />
		<ParentBizProc id="orderBP" fieldName="id" dataId="pid" cacheValue="false" />
	</swf:BizProc>
    <swf:BizProc ID="paypal" runat="server" FactoryName="paypalExpress" >
		<ParentBizProc id="checkout" dataId="info" />
		<ParentBizProc id="orderBP" dataId="order" cacheValue="false" />
		<ParentBizProc id="signupBP" dataId="contact" cacheValue="false" />
	</swf:BizProc>
	
	<div class="left"><h2><asp:Label runat="server" ID="_checkoutlbl">Check Out</asp:Label></h2></div>
	
		<saj:NitobiBizObjDisplay ID="od" runat="server" 
			ReadOnlyTemplate="eCom.Gui.AspNet.SalesOrderCheckoutDisplay" 
			ParentBizProcIds="orderBP" />
			
		<saj:DivLayers runat="server" id="dcodeArea" ParentBizProcIds="orderBP" ChildVisibility="altDisp" SkinID="DiscountArea">
			<saj:NitobiBizObjDisplay ID="dcode" runat="server" 
				ReadOnlyTemplate="eCom.Gui.AspNet.SalesOrderDiscountCodeDisplay" 
				ParentBizProcIds="orderBP" />
			<saj:ActionButton runat="server" ID="_dcodeBtn" Actions="orderBP.UpdateBizObj" Text="Apply Discount" />		
		</saj:DivLayers>
			
		<saj:ComplexBizObjListDisplay ID="pr" runat="server" ChildCssClass="ProductArea"
			ReadOnlyTemplate="eCom.Gui.AspNet.SOItemsListDisplay-ProductStyle1"
			ParentBizProcIds="orderItemBP" >
			<macros>
				<Entry name="imageRes" type="String">SmallThumbnail</Entry>
			</macros>
		</saj:ComplexBizObjListDisplay>
</asp:Content>
<asp:Content ContentPlaceHolderID="mainRight" runat="server" ID="c2">
	<div style="display:inline;float:right;min-width:250px;">
	    <art:StandAloneArticleListDisplay runat="server" id="A3" DetailLevel="fullDetails" 
			pid="ShippingDetails" ListTemplate="TitleImageBody" NavLink=""	/>
		</div>		
		
		<div style="display:inline;float:left;">
			<h3><asp:Label runat="server" ID="_contactLbl">Shipping Location</asp:Label></h3>
						<saj:NitobiBizObjDisplay ID="contactDisplay" runat="server" 
				TemplateNameBizRule="getContactAddressForSalesOrderTemplate"
				ParentBizProcIds="signupBP" />
		</div>
		<br clear="all"/>
		<!-- ShipArea -->
		<saj:DivLayers runat="server" id="shipArea" ParentBizProcIds="delivery" ChildVisibility="disp">
			<h3><asp:Label runat="server" ID="_shipInfoLbl">Shipping Method</asp:Label></h3>
			<saj:NitobiBizObjDisplay ID="dmeth" runat="server" ParentBizProcIds="delivery"
				 TemplateNameBizRule="getDeliveryOptionsDisplayName" AlwaysRefreshOnAjaxEvent="true" />
			<saj:ActionButton runat="server" ID="checkDelivery" Actions="signupBP.UpdateBizObj,delivery.SetupDeliveryOptions,orderBP.UpdateBizObj" Text="Calculate Shipping" />		
		</saj:DivLayers>
		<!-- END ShipArea -->			 
		
		<!-- PayArea -->
		<saj:DivLayers runat="server" id="paymentArea" ParentBizProcIds="paymentType" ChildVisibility="list">
			<h3><asp:Label runat="server" ID="_payOpLbl">Payment Option</asp:Label></h3>
			<art:StandAloneArticleListDisplay runat="server" id="paydet" DetailLevel="fullDetails" 
				pid="PaymentOptionNote" ListTemplate="BodyOnly" NavLink=""	/>
			<saj:ComplexBizObjListDisplay ID="ptypes" runat="server" 
					ReadOnlyTemplate="eCom.Gui.AspNet.PaymentOptionListDisplay"
					ParentBizProcIds="paymentType" >
					<macros imageRes="SmallThumbnail" />
			</saj:ComplexBizObjListDisplay>
		</saj:DivLayers>
		<!-- END PayArea -->

		<saj:NitobiBizObjDisplay runat="server" ID="cap1" ParentBizProcIds="captcha"
			ReadOnlyTemplate=""
			EditableTemplate="Syrinx.Gui.AspNet.CaptchaDisplay" />			

		<div >
			<swf:ActionButton runat="server" ID="coBtn" Actions="captcha.VerifyUser,paymentType.SetupPaymentType,signupBP.UpdateBizObj,delivery.UpdateBizObj,orderBP.UpdateBizObj,delivery.ValidateDeliveryOptions,paypal.StartExpressCheckout,checkout.MoveNext" Text="Complete Checkout"/>
		</div>
</asp:Content>